package cn.linjianhui.flink.sample.model;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;

public class OmsOrder {
    private String ORDERCODE;
    private String CUSCODE;
    private Double NETAMT;
    private Long PAYMENTDATE;
    private Long LASTMODIFYTIME;
    private Integer ORDERSTATUS;
    private Integer ORDERSOURCE;
    private String PROVINCE;
    private String PROVINCECODE;
    private Long CREATEDATE;
    private int orderHour;

    public OmsOrder() {}

    public String getORDERCODE() {
        return ORDERCODE;
    }

    public void setORDERCODE(String ORDERCODE) {
        this.ORDERCODE = ORDERCODE;
    }

    public String getCUSCODE() {
        return CUSCODE;
    }

    public void setCUSCODE(String CUSCODE) {
        this.CUSCODE = CUSCODE;
    }

    public Double getNETAMT() {
        return NETAMT;
    }

    public void setNETAMT(Double NETAMT) {
        this.NETAMT = NETAMT;
    }

    public Long getPAYMENTDATE() {
        return PAYMENTDATE;
    }

    public void setPAYMENTDATE(Long PAYMENTDATE) {
        this.PAYMENTDATE = PAYMENTDATE;
    }

    public Long getLASTMODIFYTIME() {
        return LASTMODIFYTIME;
    }

    public void setLASTMODIFYTIME(Long LASTMODIFYTIME) {
        this.LASTMODIFYTIME = LASTMODIFYTIME;
    }

    public Integer getORDERSTATUS() {
        return ORDERSTATUS;
    }

    public void setORDERSTATUS(Integer ORDERSTATUS) {
        this.ORDERSTATUS = ORDERSTATUS;
    }

    public Integer getORDERSOURCE() {
        return ORDERSOURCE;
    }

    public void setORDERSOURCE(Integer ORDERSOURCE) {
        this.ORDERSOURCE = ORDERSOURCE;
    }

    public String getPROVINCE() {
        return PROVINCE;
    }

    public void setPROVINCE(String PROVINCE) {
        this.PROVINCE = PROVINCE;
    }

    public String getPROVINCECODE() {
        return PROVINCECODE;
    }

    public void setPROVINCECODE(String PROVINCECODE) {
        this.PROVINCECODE = PROVINCECODE;
    }

    public int getOrderHour() {
        if(CREATEDATE != null) {
            LocalDateTime createTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(CREATEDATE), ZoneId.systemDefault());
            return createTime.getHour();
        }
        return orderHour;
    }

    public void setOrderHour(int orderHour) {
        this.orderHour = orderHour;
    }

    public Long getCREATEDATE() {
        return CREATEDATE;
    }

    public void setCREATEDATE(Long CREATEDATE) {
        this.CREATEDATE = CREATEDATE;
    }
}
